package com.share.service.impl;

import java.util.List;
import com.share.common.core.utils.DateUtils;
import com.share.domain.CabinetType;
import com.share.mapper.CabinetTypeMapper;
import com.share.service.ICabinetTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;



/**
 * 柜机类型Service业务层处理
 * 
 * @author Serendipity
 * @date 2025-06-24
 */
@Service
public class CabinetTypeServiceImpl implements ICabinetTypeService
{
    @Autowired
    private CabinetTypeMapper cabinetTypeMapper;

    /**
     * 查询柜机类型
     * 
     * @param id 柜机类型主键
     * @return 柜机类型
     */
    @Override
    public CabinetType selectCabinetTypeById(Long id)
    {
        return cabinetTypeMapper.selectCabinetTypeById(id);
    }

    /**
     * 查询柜机类型列表
     * 
     * @param cabinetType 柜机类型
     * @return 柜机类型
     */
    @Override
    public List<CabinetType> selectCabinetTypeList(CabinetType cabinetType)
    {
        return cabinetTypeMapper.selectCabinetTypeList(cabinetType);
    }

    /**
     * 新增柜机类型
     * 
     * @param cabinetType 柜机类型
     * @return 结果
     */
    @Override
    public int insertCabinetType(CabinetType cabinetType)
    {
        cabinetType.setCreateTime(DateUtils.getNowDate());
        return cabinetTypeMapper.insertCabinetType(cabinetType);
    }

    /**
     * 修改柜机类型
     * 
     * @param cabinetType 柜机类型
     * @return 结果
     */
    @Override
    public int updateCabinetType(CabinetType cabinetType)
    {
        cabinetType.setUpdateTime(DateUtils.getNowDate());
        return cabinetTypeMapper.updateCabinetType(cabinetType);
    }

    /**
     * 批量删除柜机类型
     * 
     * @param ids 需要删除的柜机类型主键
     * @return 结果
     */
    @Override
    public int deleteCabinetTypeByIds(Long[] ids)
    {
        return cabinetTypeMapper.deleteCabinetTypeByIds(ids);
    }

    /**
     * 删除柜机类型信息
     * 
     * @param id 柜机类型主键
     * @return 结果
     */
    @Override
    public int deleteCabinetTypeById(Long id)
    {
        return cabinetTypeMapper.deleteCabinetTypeById(id);
    }
}
